package example;

import java.util.ArrayList;
import java.util.List;

import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.bpc.staticchecker.FrameInstance;

import fr.ema.arch3d.model.architecture.Interface;
import fr.ema.arch3d.model.architecture.specification.AbstractComponentRole;
import fr.ema.arch3d.model.architecture.specification.AbstractSpecification;
import fr.ema.arch3d.model.architecture.specification.DefaultComponentRole;
import fr.ema.arch3d.model.architecture.specification.DefaultConnection;
import fr.ema.arch3d.model.architecture.specification.DefaultSpecification;
import fr.ema.arch3d.model.consistencyChecker.NameConsistencyChecker;
import fr.ema.arch3d.model.consistencyChecker.SpecificationBehaviorConsistencyChecker;

public class clientSever {

    /**
     * Method description
     *
     * @param args
     * @throws NoSuchInterfaceException 
     * @throws InstantiationException 
     */
    public static void main(String[] args) throws InstantiationException, NoSuchInterfaceException {
	Interface cItf=new Interface("cItf", "example.log", true, false,new String[]{"findName"});
	Interface sItf=new Interface("sItf", "example.log", false, false,new String[]{"findName"});
	DefaultComponentRole client=new DefaultComponentRole("client",new Interface[]{cItf},"!cItf.findName*");
	DefaultComponentRole server=new DefaultComponentRole("server",new Interface[]{sItf},"?sItf.findName*");
	DefaultConnection cs=new DefaultConnection("cs", "cItf", client, "sItf", server);
	DefaultSpecification spec=new DefaultSpecification("clientServer");
	
	spec.insertConnection(cs);	
	spec.insertCmpRole(client);
	spec.insertCmpRole(server);

	//SpecificationBehaviorConsistencyChecker.check(spec);
	//NameConsistencyChecker.check(spec, client);
    }

}
